package Models

import (
	"time"
)

/**
 * Created by Goland
 * User: wkk alisleepy@hotmail.com
 * Time: 2021/12/17 - 02:08
 * Desc: <Staff模型>
 */

const (
	INCUMBENT = "在职"
	DIMISSION = "离职"
)

// Staff 员工信息结构体
type Staff struct {
	Id             uint        `gorm:"primary_key" json:"id"`
	JobNo          string      `json:"job_no"`
	Name           string      `json:"name"`
	Birthday       time.Time   `json:"birthday"`
	DepartmentId   uint        `json:"department_id"`
	DepartmentName string      `json:"department_name"`
	CompanyId      uint        `json:"company_id"`
	CompanyName    string      `json:"company_name"`
	EntryDate      time.Time   `json:"entry_date"`
	ConfirmDate    time.Time   `json:"confirm_date"`
	Status         string      `json:"status"`
	LeaderId       uint        `json:"leader_id"`
	Leader         *Staff      `gorm:"FOREIGNKEY:Id; ASSOCIATION_FOREIGNKEY:LeaderId" json:"leader"`
	Department     *Department `gorm:"FOREIGNKEY:Id; ASSOCIATION_FOREIGNKEY:DepartmentId" json:"department"`
	LeftDate       time.Time   `json:"left_date"`
	CreatedAt      time.Time   `json:"created_at"`
	UpdatedAt      time.Time   `json:"updated_at"`
	DeletedAt      *time.Time  `json:"deleted_at;default:null"`
}
